@import './normalize.css';
@import './variables.css';

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Krona One',
    sans-serif;
    height: 100vh;
    background-color: var(--bg-color);
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: row;
    align-content: center;
    justify-content: center;
    align-items: center;
}

button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-wrapper {
    position: relative;
    z-index: 99;
    width: 100%;
    max-width: var(--game-width);
    height: 100%;
    max-height: var(--game-height);
    background-color: var(--bg-color);
    box-shadow: var(--wrapper-shadow);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-section {
    position: relative;
    text-align: center;
    font-weight: 600;
    padding: 20px;
    font-size: 25px;
    color: var(--color);
}

.board-section {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    margin: auto;
    padding: 10px;
    box-shadow: var(--board-shadow-inset);
    border-radius: 10px;
}

.block {
    width: var(--block-size);
    height: var(--block-size);
    border: 0.1px solid #525756;
}

.setting-section {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.setting-section button {
    margin: 0 10px;
    color: var(--setting-btn-color);
}

.btn {
    height: var(--button-size);
    box-shadow: var(--btn-shadow);
    border-radius: 25px;
    font-weight: 400;
    font-size: 15px;
    color: var(--color);
    background-color: #3b3b3d;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.btn:active {
    box-shadow: var(--btn-shadow-inset);
}

.control-section {
    display: none;

    .btn {
        width: 55px;
    }
}

.col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.col:nth-child(1) {
    width: 60%;
}

.col:nth-child(2) {
    width: 40%;
}

.arrow-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.btn-large {
    width: 80px !important;
    height: 80px !important;
    font-size: 30px;
}

.menu-section {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.menu-section button {
    margin-bottom: 30px;
}

.btn-width {
    width: 200px;
}

.result {
    text-align: center;
    margin-bottom: 90px;
    display: none;
}

.result p {
    color: var(--setting-btn-color);
}

.result h1 {
    color: var(--color);
    margin-bottom: 30px;
}

.how-to {
    position: relative;
    box-shadow: var(--wrapper-shadow);
    padding: 30px;
    border-radius: 20px;
    background-color: var(--bg-color);
    color: var(--color);
    margin: 0 0 0 50px;
    max-width: 400px;
}


.how-to h3 {
    margin-bottom: 40px;
}

.how-to td {
    padding: 20px;
}

.keycap {
    width: calc(var(--button-size) * 2);
    color: var(--setting-btn-color);
    font-size: 20px;
}

/* animation */

@keyframes down {
    0% {
        transform: translateY(-300%);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(90deg);
    }
}

@keyframes hide {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/*  state  */

.board-section,
.info-section,
.control-section {
    transform: scale(0);
}

.play .board-section,
.play .info-section,
.play .control-section {
    transform: scale(1);
}

.play .menu-section {
    transform: scale(0);
}

.play #btn-pause {
    display: flex;
}

.pause #btn-new-game,
.end #btn-new-game {
    display: block;
}

.end .result {
    display: block;
}

.end #btn-play {
    display: none;
}

#btn-new-game,
#btn-pause {
    display: none;
}

@media only screen and (max-width: 750px) {
    :root {
        --block-size: 25px;
    }

    .game-wrapper {
        box-shadow: unset;
        border-radius: unset;
    }

    .control-section {
        display: flex;
    }

    .setting-section {
        padding: unset;
        margin-top: -40px;
    }

    .play .setting-section {
        position: absolute;
        flex-direction: column;
        bottom: unset;
        top: 10%;
        transform: translateY(-50%);
        right: -15px;
        padding: unset;
    }

    .setting-section button {
        margin-bottom: 15px;
    }

    .how-to {
        display: none;
    }
}
